﻿#region 信息

// Copyright©2014 Rex Rao all rights reserved.
// File name : SoMcCoffee\Sohobloo.SoPermission.Data\DbInitializer.cs
// Author : Sohobloo
// Create time : 2014/01/31 23:40
// Update time : 2014/02/05 9:01

#endregion

#region 引用

using System.Data.Entity;
using Sohobloo.SoMcCoffee.Data;

#endregion

namespace Sohobloo.SoPermission.Data.Initialization
{
    public static class DbInitializer
    {
        #region 方法

        public static void Initialize()
        {
            Database.SetInitializer(new CreateDatabaseIfNotExists<EfDbContext>());
            //Database.SetInitializer(new DropCreateDatabaseAlways<EfDbContext>());
            //Database.SetInitializer(new DropCreateDatabaseIfModelChanges<EfDbContext>()); 
            Database.SetInitializer(new MigrateDatabaseToLatestVersion<EfDbContext, Migrations.Configuration>());
        }

        #endregion 方法
    }
}